package com.example.coursehub.service;
import com.example.coursehub.entity.*;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface CourseService {
    // 课程基础操作
//    Course createCourse(Course course);

    @Transactional
    Course createCourse(Course course, String userId);

    Course updateCourse(String courseId, Course course);
    void deleteCourse(String courseId);
    Course getCourseById(String courseId);
    List<Course> getAllCourses();

    // 课程内容管理
    void addMaterial(String courseId,String chapterId, Material material);
    void deleteMaterial(String courseId, String chapterId, String materialId);
    void addChapter(String courseId, Chapter chapter);
    void deleteChapter(String courseId, String chapterId);
    List<Chapter> getChapters(String courseId);

    List<Course> getCoursesByUserIdAndRole(String userId, String role);

    // 获取指定课程的所有班级
    List<Classes> getClassesByCourseId(String courseId);


    List<User> getTeachersInCourse(String courseId);
    void addTeacherToCourse(String courseId, String userId);
    void removeTeacherFromCourse(String courseId, String userId);

    void enrollStudentInCourse(String courseId, String userId);
    List<String> getTeachersByCourseId(String courseId);

    //    Chapter getChapterById(String courseId, String chapterId);
}
